package net.office.service.impl;

import net.office.bean.BaseDict;
import net.office.bean.BaseDictExample;
import net.office.mapper.BaseDictMapper;
import net.office.service.BaseDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BaseDictServiceImpl implements BaseDictService {

    @Autowired
    private BaseDictMapper baseDictMapper;

    @Override
    public BaseDict findOneByDictId(Integer dictId) {
        return baseDictMapper.selectByPrimaryKey(dictId);
    }

    @Override
    public List<BaseDict> findByDictTypeCode(String dictTypeCode) {
        BaseDictExample example = new BaseDictExample();
        example.createCriteria().andDictTypeCodeEqualTo(dictTypeCode);

        return baseDictMapper.selectByExample(example);
    }
}
